home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1997 May / PC Plus Super CD Issue 127 (May 1997).iso / handson / handson.exe / WITHUNIT.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1997-01-31  |  978 b   |  45 lines

  1. unit Withunit;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Button1: TButton;
  12.     Edit1: TEdit;
  13.     Memo1: TMemo;
  14.     procedure Button1Click(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. var
  22.   Form1: TForm1;
  23.  
  24. implementation
  25.  
  26. {$R *.DFM}
  27.  
  28. procedure TForm1.Button1Click(Sender: TObject);
  29. begin
  30.   with Edit1 do
  31.   begin
  32.     BorderStyle := bsNone;
  33.     CharCase    := ecUpperCase;
  34.     Color       := clFuchsia;
  35.     Text        := 'Agadoo, doo, doo.....';
  36.     { The following prevents Edit1 expanding beyond the right-hand edge
  37.       of Form1. Notice that, even here, the properties Left and Width,
  38.       when used without qualification, refer to Edit1 }
  39.     if (Form1.Left + Left + Width + 20 ) < (Form1.Left + Form1.Width) then
  40.        Width       := Width + 5;
  41.   end;
  42. end;
  43.  
  44. end.
  45.